package com.suray.wcs.service.hk.agv.type;

public enum HkAgvTaskStatus {

    INIT(0, "初始化"),
    RUN(1, "任务进行中"),
    DATA_ANALYZE(2, "数据处理"),
    FINISH(3, "任务完成"),
    ERROR(4, "任务故障"),
    TASK_SEND_FAIL(5, "任务下发失败"),
    TASK_CONTINUE_SEND_FAIL(6, "任务继续下发失败"),
    ;

    int value;
    String des;

    HkAgvTaskStatus(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public int getValue() {
        return value;
    }

    public static HkAgvTaskStatus parseStatus(int value) {
        for (HkAgvTaskStatus status : HkAgvTaskStatus.values()) {
            if (status.value == value) {
                return status;
            }
        }

        throw new RuntimeException("海康Agv任务状态转换错误：" + value);
    }
}
